package com.fandy.struts.SqlStatement;

public class Order {
 
	public   String  getAll()
	{
		return   "select * from Order";
	}
	
	public   String getOrderInfoByID(int ID)
	{
		return  "select * from Order where " +com.fandy.struts.Meta.Order.getOrderid()+"="+ID;
	}
	
	
	public String Add(com.fandy.struts.Model.Order s)
	{
		
		return "insert into Order values ("
		+ "'" + s.getClientid()+"',"		 
		+ "'" +s.getDepartmentid()+"',"
		+ "'"  + s.getOrderid() + "',"
		+ "'"  + s.getStaffid() + "',"
		+ "'"  + s.getDeadtime() + "',"
		+ "'"  + s.getOrdertime() + "',"
		
		+")"
		;
		
	}
	
	
	
//	public   String  existUser(com.fandy.struts.Model.Order s)
//	{
//		return  "select count(*) from Order where UserName = '"
//		+s.getOrderid()+"' "
//		+"and PassWord = '" 
//		+ s.getPassword() 
//		+ "'";
//	}
	
	public String UpdateByID(int id,com.fandy.struts.Model.Order s)
	{
		
		return "update GoodsInfo set "+com.fandy.struts.Meta.Order.getClientid()
		+"='" + s.getClientid()+"',"		 
		+com.fandy.struts.Meta.Order.getDeadtime()+"='" +s.getDeadtime()+"',"
		+com.fandy.struts.Meta.Order.getDepartmentid()+ "='"  + s.getDepartmentid() + "',"
		+com.fandy.struts.Meta.Order.getOrdertime()+ "='"  + s.getOrdertime() + "',"
		+com.fandy.struts.Meta.Order.getStaffid() + "='"  + s.getStaffid() + "',"
		
				
		+"where "+com.fandy.struts.Meta.Order.getOrderid()+"="+id;
		
	}
	
	public String DeleteByID(int id)
	{
		
		return "delete from Order where " + com.fandy.struts.Meta.Order.getOrderid() +"="+id;
		
	}
	
	
	
}

